import React from "react";
import { connect } from "react-redux";
import { Redirect } from "react-router-dom";

function Write(props) {
    if (props.loginStatus) {
        // console.log(props.loginStatus);
        return <div>写文章页面</div>;
    } else {
        return <Redirect to="/login" />;
    }
}

const mapStateToProps = state => ({
    loginStatus: state.getIn(["login", "loginStatus"])
});

const mapDispatchToProps = null;

export default connect(
    mapStateToProps,
    mapDispatchToProps
)(Write);
